﻿using System;
using System.Reflection;

namespace DBScript
{
    [Serializable]
    public class DBModel : Object
    {
        public DBModel() { }
        private string _PrimaryKey = "";
        private string _TableName = "";
        /// <summary>
        /// 主键
        /// </summary>
        public string PrimaryKey
        {
            get { return _PrimaryKey; }
            set { _PrimaryKey = value; }
        }
        /// <summary>
        /// 表名
        /// </summary>
        public string TableName
        {
            get 
            {
                if (string.IsNullOrEmpty(_TableName))
                {
                    return this.GetType().Name;
                }
                return _TableName; 
            }
            set { _TableName = value; }
        }
    }
}
